<div class="container">
    <!-- <div data-google-ad=""/> -->

    <h1>Creating a custom Checkstyle configuration</h1>

    <p>The built-in configurations that ship with the plugin will only get you so far. Chances are that you will require
        a custom configuration which fulfills your teams own set coding standard.<br/>Here's how it works:</p>
    <ol>
        <li>
            <p>
                <b>Open the Eclipse Preferences Window</b>
            </p>
            <p>
                <img src="images/open_preferences.png" alt="Open Eclipse preferences"/>
            </p>
        </li>
        <li>
            <p>
                <b>Navigate to the Checkstyle section within the Eclipse preferences</b>
            </p>
            <p><img src="images/default_preferences.png" alt="Checkstyle preferences"/>
                <br/> The Checkstyle preferences should look like this. In the upper area are some general settings
                which will be explained <a href="#!/preferences">later in detail</a>.<br/> The center/bottom area shows
                the Checkstyle configurations known to the plug-in. Only Checkstyle Configurations that are listed
                therein can be used with the plug-in. <br/> Note the <i>Sun Checks</i> configuration which we used in
                the previous chapter as check configuration for our project. <br/>
                <i>Sun Checks</i> is a built-in standard configuration that comes delivered with Checkstyle and
                therefore also with the plug-in. Built-In configurations cannot be modified nor be deleted.</p>
        </li>
        <li>
            <p>
                <b>Click the</b>
                <i>New...</i>
                <b>button to create a new checkstyle configuration</b>
            </p>
            <p><img src="images/new_config.png" alt="Check Configuration properties"/>
                <br/> The Check Configuration Properties dialog comes up. Its quite empty so we must provide some data
                to create our Checkstyle configuration. <br/> At first we must decide which type of configuration we
                would like to create. There are several configuration types - each suitable for specific use cases.
                <br/> Don&#39;t mind all these types for now - for starters we will be creating a <i>Internal
                    Configuration</i>. <br/> Note that the location text field will be grayed out as you select this
                configuration type. This is because internal configurations are stored deep within the bowels of the
                eclipse workspace. <br/> The plug-in will create a unique filename for our new configuration. <br/> To
                complete our configuration we must provide a name - the description is optional and can be used to
                describe what your configuration is all about.</p>
            <p><img src="images/new_config_filled.png"
                    alt="Check Configuration properties
                        filled"/>
                <br/> When you are done the dialog should look like this. Don&#39;t worry if you done something wrong
                the dialog will tell you. <br/> Press OK to return to the main configuration screen. The configuration
                you created should show up in the configuration table. <br/> You can go back to this dialog by selecting
                the configuration and pressing <i>Properties...</i>
                <br/> Our configuration is (of course) quite empty because we have not yet defined any checks.</p>
        </li>
        <li>
            <p>
                <b>Select the configuration you created and press <i>Configure...</i> to open the Configuration
                    Editor</b>
            </p>
            <p><img src="images/configuration_editor_new.png"
                    alt="Checkstyle Configuration
                        Editor"/>
                <br/> In the left hand side tree all modules known to the plug-in are shown. These are all modules that
                come with Checkstyle out-of-the-box. <br/> The modules are semantically grouped into categories. <br/>
                The table on the right side shows the modules your configuration is actually containing. <br/> Based on
                the selection in the tree all modules in your configuration belonging to the selected group are shown.
                <br/> If you select a module in the tree or in the table a description of the module will be shown in
                the description area of the dialog. <br/> To add a particular module to your configuration you must
                select the module in the tree press the <i>Add...</i> button. <br/> For instance we open the first group
                    <i>Javadoc Comments</i> and select the <i>Method Javadoc</i> module. <br/> Pressing the
                    <i>Add...</i> button the property dialog for this module is shown.</p>
            <p><img src="images/module_editor.png" alt="Checkstyle Module Editor"/>
                <br/> Using the dialog you can customize the check for your needs. <br/> Mostly all modules have a
                severity combo box. With this you can specify if a violation of the check results in an error, warning
                or an info. <br/> The other settings in the editor are highly specific to the module. But don&#39;t
                bother for now, pressing OK will add the module to your configuration. <br/> The result should look like
                this:</p>
            <p><img src="images/configuration_editor_filled.png"
                    alt="Checkstyle Configuration
                        Editor filled"/>
                <br/> Now your configuration contains the <i>Method Javadoc</i> check. <br/> Operating the
                    <i>enabled</i> check box in the table lets you easily set the severity of the module to
                    <i>ignore</i>. <br/> OK, now you figured it all out! <br/> Press <i>OK</i> to save your
                configuration and return to the main configuration page. <br/> In the main dialog press <i>OK</i> to
                store all changes you made.</p>
        </li>
        <li>
            <p>
                <b>Go back to the project properties and select your configuration to be used to check your project</b>
            </p>
            <p><img src="images/preferences_first_config.png"
                    alt="Checkstyle Project
                        Properties"/>
                <br/> After you press <i>OK</i> your project will be rebuilt using your self created configuration.
                <br/> Look into the Eclipse Problems View again to see the effects. Now only Checkstyle warnings
                regarding missing or invalid method Javadoc should be there.</p>
        </li>
    </ol>
    <h3>Congratulations!</h3>
    <p>Now we&#39;ve covered all the basics of the Eclipse Checkstyle Plug-in. <br/> Now you surely want to dive in and
        create an extensive configuration - trying out all checks that Checkstyle has to offer (which are a lot!).</p>
    <p>Detailed information on the configuration options for each check can be found on the Checkstyle website:</p>
    <ul>
        <li>
            <a target="_blank" href="http://checkstyle.sourceforge.net/config_javadoc.html">Javadoc Comments <i
                    class="fa fa-external-link"> </i></a>
        </li>
        <li>
            <a target="_blank" href="http://checkstyle.sourceforge.net/config_naming.html">Naming Conventions <i
                    class="fa fa-external-link"> </i></a>
        </li>
        <li>
            <a target="_blank" href="http://checkstyle.sourceforge.net/config_imports.html">Imports <i
                    class="fa fa-external-link"> </i></a>
        </li>
        <li>
            <a target="_blank" href="http://checkstyle.sourceforge.net/config_sizes.html">Size Violations <i
                    class="fa fa-external-link"> </i></a>
        </li>
        <li>
            <a target="_blank" href="http://checkstyle.sourceforge.net/config_whitespace.html">Whitespace <i
                    class="fa fa-external-link"> </i></a>
        </li>
        <li>
            <a target="_blank" href="http://checkstyle.sourceforge.net/config_modifier.html">Modifiers <i
                    class="fa fa-external-link"> </i></a>
        </li>
        <li>
            <a target="_blank" href="http://checkstyle.sourceforge.net/config_blocks.html">Blocks <i
                    class="fa fa-external-link"> </i></a>
        </li>
        <li>
            <a target="_blank" href="http://checkstyle.sourceforge.net/config_headers.html">Headers <i
                    class="fa fa-external-link"> </i></a>
        </li>
        <li>
            <a target="_blank" href="http://checkstyle.sourceforge.net/config_coding.html">Coding Problems <i
                    class="fa fa-external-link"> </i></a>
        </li>
        <li>
            <a href="http://checkstyle.sourceforge.net/config_design.html">Class Design <i class="fa fa-external-link"
                > </i></a>
        </li>
        <li>
            <a href="http://checkstyle.sourceforge.net/config_misc.html">Miscellaneous <i class="fa fa-external-link"
                > </i></a>
        </li>
    </ul>
</div>
